Skip to content

Conversation

@rvagg
Copy link
Collaborator

@rvagg rvagg commented Oct 22, 2025

Edit: This got switched to having 0.06 USDFC as the floor, not the bytes; so now the bytes works out as ~24.576 GiB and we get to talk about it in terms of cents per month.

(PR on top of #316, that should be merged first)

Amounts below this pay as if they are storing 24 GiB, which is 0.05859375 USDFC / month.

Closes: #319


  • 24 GiB = 24/1024 TiB = 0.0234375 TiB
  • At 2.5 USDFC/TiB/month, price = 0.0234375 * 2.5 = 0.05859375 USDFC/month

Are we OK with 0.05859375? I have an option here of either setting 24GiB as the floor size or 0.06 as the floor price.

If we go with 0.06 as the floor then we're working with 24.576 GiB floor size.


I also had to change the mock token from 6 decimal places to 18, cause there's already a floor rounding bit of code in here and it was getting stuck on a higher floor due to not enough decimal places, so everything came out wrong.

@FilOzzy FilOzzy added this to FS Oct 22, 2025
@github-project-automation github-project-automation bot moved this to 📌 Triage in FS Oct 22, 2025
@rvagg rvagg force-pushed the rvagg/floor_price branch from 5062f41 to 9e3ac3d Compare October 22, 2025 13:06
@lucaniz
Copy link

lucaniz commented Oct 22, 2025

So,
the calculator shows that over 23 GiB size we turn profit positive, so that's what I was taking as the reference, and then took the rounded value for price.

Either way is fine tbh. We should pick the easiest route.

Maybe the easiest way to do so is setting the min price to 0.57 which is 23.35 GiB, which is also fine....

@lucaniz
Copy link

lucaniz commented Oct 22, 2025

We can also set 0.5 and be covered againt a slightly smaller basefee max value (at the end of the day we picked the march 2025 avg because there were some oscillation back then, but it is better to come up with a fixed value, I think it won't make a huge difference)

@rjan90 rjan90 moved this from 📌 Triage to 🔎 Awaiting review in FS Oct 22, 2025
@rjan90 rjan90 requested a review from ZenGround0 October 22, 2025 14:58
Base automatically changed from phi/revert-revert to main October 22, 2025 21:06
@rvagg rvagg force-pushed the rvagg/floor_price branch from 9e3ac3d to 0cf87b5 Compare October 23, 2025 10:44
@rvagg rvagg changed the title feat: floor price set to the equivalent of 24 GiB feat: floor price set to the 0.06 USDFC/month Oct 23, 2025
@Kubuxu
Copy link
Contributor

Kubuxu commented Oct 23, 2025

Is it feasible to add a check that the floor price rate is available to be paid when doing createDataSet? It would solve one of the problems causing: filecoin-project/curio#726

@timfong888
Copy link

My take away: if it's a minimum from which storage providers are paid as thing as used, this "top up" model is understandable and much better in $ units. I think it's probably better and clearer if it were a larger amount than a couple of cents. $1-5 is not unusual for top-up based usaged pricing models.

@rvagg rvagg force-pushed the rvagg/floor_price branch 2 times, most recently from 22e3f0d to 0b31223 Compare October 24, 2025 06:11
@rvagg
Copy link
Collaborator Author

rvagg commented Oct 24, 2025

Is it feasible to add a check that the floor price rate is available to be paid when doing createDataSet?

Oh, this is a really good idea, and yes it is possible! We have a getAccountInfoIfSettled on FilecoinPay that we can use to check their balance (if they were fully settled) so we can compare that with what would be needed for initial lockup and reject early. With create+add this is nice and clean. With create, then add, it's a little more messy and we lose guarantees but you'd just get rejected at add if you used up funds in between the two calls. If nextProvingPeriod gets done immediately after create+add then Curio should have a pretty solid guarantee that there is at least 0.06 on the table if they prove for a month, with a slight window for a possible race.

See latest commit in here for that feature.

@Kubuxu
Copy link
Contributor

Kubuxu commented Oct 24, 2025

Does that also cover OperatorRateAllowanceExceeded?

rvagg added 2 commits October 24, 2025 23:16
For storage amounts below ~24.576 GiB, the rate will be 0.06 USDFC / month.
Above this amount the price is per-byte.

Closes: #319
@rvagg rvagg force-pushed the rvagg/floor_price branch from c9e8ffa to 0f671ca Compare October 24, 2025 12:23
rvagg added 2 commits October 24, 2025 23:25
Add comprehensive validation of operator approval settings alongside
existing minimum balance check during createDataSet operation.
Validates operator is approved with sufficient rate allowance, lockup allowance,
and max lockup period.
@rvagg rvagg force-pushed the rvagg/floor_price branch from 0f671ca to 51efea9 Compare October 24, 2025 12:25
@rvagg
Copy link
Collaborator Author

rvagg commented Oct 24, 2025

Figured out how to add additional checks in there. I'm of two minds about this, mostly it's great UX, we catch errors early and can be descriptive about it - good for SPs and good for users. But it also adds complexity and gets FWSS more deeply involved in something that it feels like should be something should be able to ask Filecoin Pay to figure out for us. But it's probably fine.

  • InsufficientFundsForMinimumRate - not enough deposit
  • OperatorNotApproved - need to approve FWSS
  • InsufficientRateAllowance - not enough approval for the minimum rate (0.06/month)
  • InsufficientLockupAllowance - not enough lockup approval for minimum rate @ 30 days
  • InsufficientMaxLockupPeriod - not enough lockup period approval for the 30 day lockup

@Kubuxu
Copy link
Contributor

Kubuxu commented Oct 24, 2025

But it's probably fine.

We will be able to remove it when we combine createDataSet and initial nextProvePeriod.

Copy link
Contributor

@Kubuxu Kubuxu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGTM

@github-project-automation github-project-automation bot moved this from 🔎 Awaiting review to ✔️ Approved by reviewer in FS Oct 24, 2025
@Kubuxu
Copy link
Contributor

Kubuxu commented Oct 24, 2025

I'm going to merge it as is, if we want to improve stuff just a bit, let's open a new PR.

@Kubuxu Kubuxu merged commit 6cb08ce into main Oct 24, 2025
6 checks passed
@Kubuxu Kubuxu deleted the rvagg/floor_price branch October 24, 2025 15:50
@github-project-automation github-project-automation bot moved this from ✔️ Approved by reviewer to 🎉 Done in FS Oct 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🎉 Done

Development

Successfully merging this pull request may close these issues.

Set up minimum price for ProofSet

6 participants